package com.example.demos.web.controller;


import com.example.demos.dto.MenuDTO;
import com.example.demos.service.MenuService;
import com.example.demos.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/v2/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/select")
    public Result<List<MenuDTO>> select(HttpSession session) {
        List<MenuDTO> select = menuService.select(session);
        return Result.ok(select);
    }

}
